﻿<!DOCTYPE html>
<html>
<meta http-equiv="X-UA-Compatible" content="IE=7">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<head>
    <title>用户列表</title>
    <!--引入样式和JS-->
    <link rel="stylesheet" href="/static/Skins_/css/blue/reset.css" type="text/css" />
    <link rel="stylesheet" href="/static/Skins_/css/blue/global.css" type="text/css" />
    <script src="/static/loadjs1.js"></script>
    <!--提示框-->
    <script src="/static/Skins/jquery.hiAlerts.1.0/jquery.hiAlerts-min.js" type="text/javascript"></script>
    <link href="/static/Skins/jquery.hiAlerts.1.0/jquery.hiAlerts.css" rel="stylesheet" type="text/css" media="screen" />
    <!--tableEx需要引入-->
    <link rel="stylesheet" href="/static/Skins_/tableEx/images/tableEx.css"/>
    <script type="text/javascript" src="/static/Skins_/tableEx/js/lhgdialog/lhgdialog.min.js?s=facebook"></script>
    <script type="text/javascript" src="/static/Skins_/tableEx/js/tableEx.js"></script>

    <script>
        var basearg={}
        basearg.r=getRnd();
        basearg.ajaxurl="/f00/user/ajax";
        //新建用户
        function doadd(){
            var v=showModal("/f00/user/list?act=add&r="+getRnd(),640,360);
            if(v.username){
                v.act="save";v.r=getRnd();
                blockui("保存数据...");
                $.post("/f00/user/ajax",v,function(data){showOkMsg("保存成功"); gopage(${i.pageindex});},"json");
            }
        }
        //修改用户信息
        function doedit(id){
            var v=showModal("/f00/user/list?act=edit&id="+id+"&r="+getRnd(),640,360);
            if(v.username){
                v.act="edit";v.r=getRnd();
                blockui("保存数据...");
                $.post("/f00/user/ajax",v,function(data){showOkMsg("保存成功");gopage(${i.pageindex});},"json");
            }
        }
        //删除用户
        function dodel(id){
            if(confirm("确认删除数据吗？")){
                var v={};v.id=id;v.r=getRnd();v.act="del";
                $.post("/f00/user/ajax",v,function(data){showOkMsg("保存成功");gopage(${i.pageindex});},"json");
            }
        }
        //重置用户密码
        function restorepwd(id){
            if(confirm("确认恢复此用户的密码吗？")){
                var v={};v.id=id;v.r=getRnd();v.act="restorepwd";
                $.post("/f00/user/ajax",v,function(data){showOkMsg("密码成功恢复成123456,提醒用户登录后修改密码");gopage(${i.pageindex});},"json");
            }
        }
        //停用
        function dostop(id){
            if(confirm("确认停用此用户吗？")){
                var v={};v.id=id;v.r=getRnd();v.act="stop";
                $.post("/f00/user/ajax",v,function(data){
                    if(data.result=="OK"){
                        showOkMsg("成功停用!");
                    }else{
                        showErrorMsg("停用失败！");
                    }
                    gopage(${i.pageindex});
                },"json");
            }
        }
        //停用
        function dostart(id){
            if(confirm("确认启用此用户吗？")){
                var v={};v.id=id;v.r=getRnd();v.act="start";
                $.post("/f00/user/ajax",v,function(data){
                    if(data.result=="OK"){
                        showOkMsg("成功启用!");
                    }else{
                        showErrorMsg("启用失败！");
                    }
                    gopage(${i.pageindex});
                },"json");
            }
        }
        //设置用户权限
        function setpower(id){
            v=showModal("/f00/userpower/list?userid="+id+"&r="+getRnd(),580,640);
        }
        //导出用户权限
        function export1(id){
            if(confirm("确认导出此用户的权限明细么？")){
                var v={};v.id=id;v.r=getRnd();v.act="export1";
                blockui("正在导出...")
                $.post( "/f00/user/ajax",v,function(data){$.unblockUI();location.href=data.result;},"json");
            }
        }
        //导出用户全部权限
        function doexport(){
            if(confirm("确认导出全部用户的权限明细么？")){
                var v={};v.r=getRnd();v.act="export";
                blockui("正在导出...")
                $.post("/f00/user/ajax",v,function(data){$.unblockUI();location.href=data.result;},"json");
            }
        }
    </script>
</head>
<body>
<div class="crumbs">
	<a href="">系统</a><a href="">用户权限</a><span>用户权限</span>
	<div class="mininav"><a href="/static/welcome.html" rel1="tips_n" original-title="首页"><b class="icons ihome"></b></a><a href="javascript:;" onclick="showModal('/static/hlp/f00/user.html',600,360)" rel1="tips_n" original-title="帮助"><b class="icons ihelp"></b></a><a href="javascript:;" onclick="showModal('/f00/feedback?funno=user',800,480)" rel1="tips_n" original-title="反馈"><b class="icons ibug"></b></a></div>
</div>
<form action="/f00/user/list" method="post" id="form1" name="form1">
    <div class="tool_table notab">
        <div class="button"><a href="#" id="add" class="button_gray button_icon_search"><b></b>查询</a></div>
        <div class="button"><a href="#" id="doadd" onclick="doadd()" class="button_gray button_icon_add"><b></b>增加</a></div>
        <div class="button"><a href="#" id="doexport" onclick="doexport()" class="button_gray"><b class="icons iexcel"></b>导出用户权限明细</a></div>
    </div>
    <%include file="/T/Pager.html"/>
    <%include file="TT/query0.html"/>
</form>

</body>
</html>
